// LennardJones.cpp: archivo de proyecto principal.

#include <complex>
#include <fstream>
#include <iostream>
//#include <ofstream.h>
#include <string.h>
#include <iomanip>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include<time.h>


using namespace std;


#define kB 8.314e-03
#define maxK 10000
#define KsqMax  49
#define Kmax 7
#define pi 3.1416

#include "utils.h"
#include "particulas.h"
#include "caja.h"
#include "interaccion.h"
#include "verlet.h"
//#include "dynamic.h"


int main(void)
{
	double Temp=0.1;
	double delta=1.0;
	double diff=0.005;
	double npart=125;
	double phi=0.05;
	double rcut=2.5;
	double Etotal;
	double Dt=0.005;

	char name[30];
	sprintf(name,"%s","config");
	caja *box = new caja(npart, Temp, phi, rcut);

	box->printXYZfile(name, 0);
	box->listaVecinos();
	cout<<"nvecinos: "<<box->part[1].nvecinos<<endl;
	for (int i=0;i<10000;i++)
	{
		//box->followPart(0);
		if (i%1==0)
			box->listaVecinos();
		Etotal=interaccion(box,rcut);

		verlet(box,Dt);
		//randomMovement(box,0.05);
		if(i%10==0)
		{
		//cout<<Etotal<<endl;
		box->printXYZfile(name, i);
		}
	}

	delete box;

//	box.Temp=Temp;
//	box.npart = npart;
//	box.initSquareBox(npart, Temp, phi);
//	dynamic din;
//	din.initial(box, delta, diff);
//
//	cout<<"*************** Ewald"<<endl;
//	ewald ewd;
//	ewd.initial(box);
//	ewd.setupEwald();
//	ewd.initialCharges();
//	ewd.ewrForcesCharges();
//	ewd.ewkForcesCharges();
//	ewd.sumForces();
//
//	for(int i=0;i<1000;i++)
//	{
//		cout<<i<<endl;
//	din.box = ewd.box;
//	din.gaussian();
//	din.updateR();
//	din.updateV();
////
////
////	ewd.box = din.box;
////
////	ewd.ewrForcesCharges();
////	ewd.ewkForcesCharges();
////	ewd.sumForces();
//	}


	cout<<"sacabo"<<endl;
	//system("PAUSE");
	return EXIT_SUCCESS;
};

